class CreateProjects < ActiveRecord::Migration
  def self.up
    create_table :projects do |t|
      t.column "title",:string
      t.column "hit",:int,:default => 0
      t.column "createDate",:datetime,:default => Time.now
      t.column "IsComment",:bool,:default => true
      t.column "coverPicture",:string
      t.column "publicUrl",:string
      t.column "privateUrl",:string
      t.column "intro",:text
      t.column "source",:string
      t.column "sortid",:int,:default => 0
      t.column "solution_id",:int
    end
    
    create_table:projects_types do |t|
      t.column "project_id",:int
      t.column "type_id",:int
    end
  end

  def self.down
    drop_table :projects
    drop_table :projects_types
  end
end
